package com.example.springmvc_exception.通过接口实现全局异常;

import com.example.springmvc_exception.BusinessException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@RequestMapping("/querySingleBook")
public class querySingleBook {

    @ResponseBody
    public void querySingleBook(){
        if(2<3){
            throw new BusinessException("抛出异常~");
        }
    }

}